package cn.dengta.webapp.user.vo;

import javax.annotation.Nullable;

import cn.dengta.webapp.base.vo.AbstractVO;
import cn.dengta.webapp.user.entity.RecruitAd;
import cn.dengta.webapp.user.model.ChannelType;
import lombok.Getter;
import lombok.Setter;
import me.codeplayer.util.X;

/**
 * 投放招募
 */
@Setter
@Getter
public class RecruitAdVO extends AbstractVO<RecruitAd> {

	/** 广告ID */
	String adId;
	/** 渠道 */
	ChannelType channel;
	/** 状态 */
	Integer status;
	/** 代理商 */
	String merchant;

	public static RecruitAdVO from(@Nullable RecruitAd source) {
		return copy(source, RecruitAdVO::new);
	}

	public String getAddTime_() {
		return super.getAddTime_();
	}

	public Integer getChannel() {
		return X.map(channel, ChannelType::getValue);
	}

	public String getChannel_() {
		return X.map(channel, ChannelType::name);
	}

}
